package com.sf.sms.user.service.impl;

import com.sf.sms.user.dao.UserMapper;
import com.sf.sms.user.entity.User;
import com.sf.sms.user.service.IMsUserBiz;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by 80002004 on 2016/8/29.
 */
@Service("userBiz")
public class MsUserBizImpl implements IMsUserBiz {

    @Resource
    private UserMapper userMapper;

    @Override
    public User findByName(String userName) {
        List<User> users = userMapper.findByName(userName);
        if(CollectionUtils.isNotEmpty(users)) {
            return users.get(0);
        }
        return null;
    }
}
